package com.zbkj.admin.controller.publicly;

import com.zbkj.dal.base.enums.*;
import com.zbkj.dal.base.enums.show.EnumInterface;
import com.zbkj.dal.base.enums.show.EnumShowVO;
import com.zbkj.dal.base.result.CommonResult;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "api/publicly/enum")
public class EnumController {

    /**
     * 订单状态
     *
     * @return {@link OrderStatusEnums}
     */
    @GetMapping("/order/status")
    public CommonResult<List<EnumShowVO<Integer>>> orderStatus() {
        return CommonResult.success(EnumInterface.generate(OrderStatusEnums.values()));
    }

    /**
     * 送货方式
     *
     * @return 枚举类型
     */
    @GetMapping("/order/delivery/type")
    public CommonResult<List<EnumShowVO<Integer>>> orderDeliveryType() {
        return CommonResult.success(EnumInterface.generate(OrderDeliveryType.values()));
    }

    @GetMapping("/user/status")
    public CommonResult<List<EnumShowVO<String>>> userStatus() {
        return CommonResult.success(EnumInterface.generate(UserStatus.values()));
    }

    @GetMapping("/user/identity")
    public CommonResult<List<EnumShowVO<String>>> userIdentity() {
        return CommonResult.success(EnumInterface.generate(UserIdentity.values()));
    }

    @GetMapping("/quota/change-type")
    public CommonResult<List<EnumShowVO<String>>> quotaChangeType() {
        return CommonResult.success(EnumInterface.generate(QuotaChangeType.values()));
    }

    @GetMapping("/withdraw/status")
    public CommonResult<List<EnumShowVO<String>>> withdrawStatus() {
        return CommonResult.success(EnumInterface.generate(WithdrawStatusEnums.values()));
    }
}
